set result to gSoundObject(mSetSoundFile, the pathName & soundName, 2, 1)
if result <> 0 then
put "An error occurred while setting the sound file (" & string(result) & ")"
alert("Unable to create a sound file. If you are running this off of a CD-ROM, please copy the Sound XObject demo folder to your hard drive and run this Director movie from there.")
end if
if result = 0 then
put "ready to record" into field "status"
else
put "unable to create a sound file" into field "status"
end if
end
on RecordSound
global gSoundObject
set result to gSoundObject(mRecord)
if result <> 0 then
beep()
put "An error occurred when trying to record the sound (" & string(result) & ")"
end if
if result = 0 then
put "recording a sound" into field "status"
else
put "error" into field "status"
end if
end
on PlaySound
global gSoundObject
set result to gSoundObject(mPlay)
if result <> 0 then
beep()
put "An error occurred when trying to play the sound (" & string(result) & ")"
end if
end
on StopSound
global gSoundObject
set result to gSoundObject(mStop)
if result <> 0 then
beep()
put "An error occurred when trying to stop the sound (" & string(result) & ")"